package hexin.controller;

import hexin.bean.User;
import hexin.service.UserService;
import org.springframework.stereotype.Controller;

import javax.annotation.Resource;

@Controller("userController")
public class UserController {
    private int id;
    private User user;
    private UserService userService;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public UserService getUserService() {
        return userService;
    }

    @Resource(name = "userService")
    public void setUserService(UserService userService) {
        this.userService = userService;
    }

    public void add() {
        userService.add(user);
    }

    public void delete() {
        userService.delete(id);
    }

    public void load() {
        userService.load(id);
    }
}
